﻿@using Resources
<ul class="top_menu">
    <li class="welcome">
        <div class="welcome_pic">
            <img alt="welcome" src="@Url.Content("~/Content/images/welcome_icon.gif")" width="23" height="21" />
        </div>
        <div class="welcome_font">@ViewResource.MainMenu_Welcome,@Context.User.Identity.Name</div>
    </li>
    <li class="top_menu_bg" />
    <li>
        @Html.ActionLink(@MenuResource.TopMenu_SystemStatus, "Index", "Home")
    </li>
    <li class="top_menu_bg" />
    <li>
        @Html.ActionLink(@MenuResource.TopMenu_SettingsWizard, "NetAccessType", "SetupWizard")
    </li>
    <li class="top_menu_bg" />
    <li>
        @Html.ActionLink(@MenuResource.TopMenu_CurrentStatus, "TaskDetail", "Task")
    </li>
    <li class="top_menu_bg" />
    <li>
        @Html.ActionLink(@MenuResource.TopMenu_HistoricalData, "TaskHistory", "Task")
    </li>
    <li class="top_menu_bg" />
    <li>
        @Html.ActionLink(@MenuResource.TopMenu_SystemManagement, "Index", "System")
    </li>
    <li id="liNowTime">
        <div class="nowtime"></div>
    </li>
    <li class="ui-helper-clearfix"></li>
</ul>

<script type="text/javascript">
    $(function () {
        $('.top_menu li:eq(@((ViewBag.CurrentMainMenu ?? 1)*2))').addClass('currentMainMenu');
        nowTime();
    });

    function nowTime() {
        var today = new Date(), nowHour = today.getHours(), nowMinute = today.getMinutes(), nowSecond = today.getSeconds();
        $("#liNowTime div").html("当前时间：" + formatNum(nowHour) + "：" + formatNum(nowMinute) + "：" + formatNum(nowSecond));
        setTimeout(nowTime, 1000);
    }

    function formatNum(num) {
        if (num >= 10) return num;
        return '0' + num;
    }
</script>
